package com.jt.demo4;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration//标识当前类是配置类
@ComponentScan("com.jt.demo4") //包扫描注解;让spring注解生效
public class SpringConfig {

    @Bean
    public Dog dog(){
        return new Dog();
    }
}
